<template>
    <svg aria-hidden="true" class="icon">
        <use :xlink:href="symbolId"></use>
    </svg>
</template>
  
<script lang="ts" setup>
import { computed } from 'vue';

const props = withDefaults(
    defineProps<{ prefix?: string, name: string, path?: string }>(),
    { prefix: '#icon-', path: '/spritemap.svg' }
)

const symbolId = computed(() => `${props.path}${props.prefix}${props.name}`)

</script>

<style scoped lang="scss">
.icon {
    width: 20px;
    height: 20px;
}
</style>
  